#!/bin/bash

set -eux

### --start_docs
## Prepare images for deploying the overcloud
## ==========================================

## Prepare Your Environment
## ------------------------

## * Source in the undercloud credentials.
## ::

source {{ working_dir }}/stackrc

{% if undercloud_enable_nova|bool %}
## * Upload images to glance.
## ::
{% else %}
## * Copy images to /var/lib/ironic/images.
## ::
{% endif %}

openstack overcloud image upload
{%- if containerized_undercloud|bool %}
    --http-boot=/var/lib/ironic/httpboot
{%- endif %}
{%- if whole_disk_images|bool %}
    --whole-disk
{%- endif %}
{%- if not undercloud_enable_nova|bool %}
    --local
{%- endif %}

### --stop_docs
